import React from 'react'
import { Table, Button, Form, Input } from 'antd';


export default function NewsPublish(props) {
  const columns = [
    {
      title: '新闻标题',
      dataIndex: 'title',
      key: 'title',
      render(h, item) {
        return (
          <a href={`#/news-manage/preview/${item.roleId}`}>{item.title}</a>
        )
      },
    },
    {
      title: '作者',
      dataIndex: 'author',
      key: 'author',
    },
    {
      title: '新闻分类',
      dataIndex: 'gender',
      key: 'gender',
    },
    {
      title: '操作',
      render(h, item) {
        return props.button(item.roleId)
      },
    }
  ];
  return (
    <div>
       <Table 
        dataSource={props.dataSource} 
        columns={columns}
        rowKey={(item) => item.roleId} 
      />
    </div>
  )
}
